# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=expat

pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=2.1.0
pkgrel=3
pkgdesc="An XML parser library (mingw-w64)"
arch=('any')
url="http://expat.sourceforge.net"
license=("custom")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "${MINGW_PACKAGE_PREFIX}-pkg-config")
options=('strip' 'staticlibs')
source=("http://downloads.sourceforge.net/expat/expat-${pkgver}.tar.gz")
md5sums=('dd7dab7a5fea97d2a6a43f511449b7cd')

build() {
    mkdir -p "${srcdir}/${pkgname}-${pkgver}-build-${CARCH}"
    cd "${srcdir}/${pkgname}-${pkgver}-build-${CARCH}"
    "${srcdir}"/expat-${pkgver}/configure \
      --prefix=${MINGW_PREFIX} \
      --build=${MINGW_CHOST} \
      --host=${MINGW_CHOST} \
      --target=${MINGW_CHOST} \
      --enable-shared --enable-static
    make
}

package() {
    cd "${srcdir}/${pkgname}-${pkgver}-build-${CARCH}"
    make DESTDIR="$pkgdir" install
    mv "${pkgdir}${MINGW_PREFIX}/bin/xmlwf" "${pkgdir}${MINGW_PREFIX}/bin/xmlwf.exe"
}
